#pragma once

#include <QtWidgets/QWidget>
#include "ui_KCPClientTest.h"
#include <QTimer>

QT_BEGIN_NAMESPACE
namespace Ui { class KCPClientTestClass; };
QT_END_NAMESPACE

class KCPClientTest : public QWidget
{
    Q_OBJECT

public:
    KCPClientTest(QWidget *parent = nullptr);
    ~KCPClientTest();

private slots:

	void Tick();

    void on_Connect_clicked();

    void on_Disconnect_clicked();

    void on_Send_clicked();

private:

	void OnConnectCompleted(int code, std::string error);

	void OnDisconnected();

	void OnReceived(char* data, int len);

private:
    Ui::KCPClientTestClass *ui;
    QTimer* timer = nullptr;
};
